﻿using System;
using System.Text;

namespace Devv.FreshTracker
{
	public class WindowsMonitor
	{
		#region Foreground window



		public static void GetActiveWindowTitle(ref String windowTitle)
		{
			Int32 chars = 256;
			StringBuilder buff = new StringBuilder(chars);

			IntPtr handle = NativeMethods.GetForegroundWindow();

			if (NativeMethods.GetWindowText(handle, buff, chars) > 0)
			{
				windowTitle = buff.ToString();
			}
		}

		#endregion
	}
}